window.onload = function () {
	console.log(window.location.search);

	var id = window.location.search.match(/\d+/)[0];

	console.log(id);
	discount(id)
	// 根据id渲染对应的商品详情
	function discount(id) {
		// 发送请求
		$.ajax({
			type: "get",
			url: "http://193.112.55.79:9090/api/getdiscountproduct",
			data: {
				productid: id
			},
			beforeSend: function () {},
			datatype: "json",
			success: function (res) {
				console.log(res);
				// 调用模板渲染数据
				template.config("escape", false);
				var htmlStr = template("discount_detailsTmp", res);
				$(".details").html(htmlStr);
			}
		})
	}


}